using M13.Base;
using QFramework;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

namespace M13.Game
{
    public class GameManager : MonoBehaviour, IController
    {
        private void Start()
        {
            DontDestroyOnLoad(this);
            this.RegisterEvent<IntoWorld>(e => 
            { 
                SceneManager.LoadSceneAsync("Main_World"); 
                this.GetModel<IGameModal>().GameSaveConfig.Value = e.saveConfig;
            });

            this.RegisterEvent<QuitWorld>(e =>
            {
                SceneManager.LoadSceneAsync("Main_Interface");
            });
        }
        public IArchitecture GetArchitecture()
        {
            return GameArchitecture.Interface;
        }
    }
}